<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>安装</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="openssl.requirements.html">需求</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="openssl.configuration.html">运行时配置</a></div>
 <div class="up"><a href="openssl.setup.html">安装／配置</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="openssl.installation" class="section">
 <h2 class="title">安装</h2>
 <p class="para">
  To use PHP&#039;s OpenSSL support you must also compile PHP <strong class="option configure">--with-openssl[=DIR]</strong>
.
 </p>
 <p class="para">
  The OpenSSL library also has additional requirements for normal operation at
  run-time. Most notably, OpenSSL requires access to a random or pseudo-random
  number generator; on most Unix and Unix-like platforms (including Linux),
  this means that it must have access to a <em>/dev/urandom</em> or
  <em>/dev/random</em> device.
 </p>
 <blockquote class="note"><p><strong class="note">Note</strong>: 
  <strong>Note to Win32 Users</strong><br />
  <p class="para">
   为了使此扩展生效，
<acronym title="Dynamic Link Library">DLL</acronym> 文件必须能在 Windows 系统的
<em>PATH</em> 指示的路径下找到。如何操作的信息，请参见题为“<a href="faq.installation.html#faq.installation.addtopath" class="link">如何在 Windows 中将 PHP
目录加到 PATH 中</a>”的<acronym title="Frequently Asked Questions">FAQ</acronym>。虽然将
DLL 文件从 PHP 文件夹复制到 Windows 系统目录也行，但不建议这样做。
<em class="emphasis">此扩展需要下列文件在 <em>PATH</em> 路径中：</em>
   <var class="filename">libeay32.dll</var>
  </p>
  <p class="para">
   Additionally, if you are planning to use the key generation and certificate
   signing functions, you will need to install a valid
   <var class="filename">openssl.cnf</var> file on your system.
   As of PHP 4.3.0, we include a sample configuration file
   in our win32 binary distributions.
   PHP 4.3.x and 4.4.x has the file in the
   <var class="filename">openssl</var> directory.
   PHP 5.x and 6.x has the file in the
   <var class="filename">extras/openssl</var> directory.
   If you are either using PHP 4.2.x or missing the file, you can obtain it from
   <a href="http://www.openssl.org/related/binaries.html" class="link external">&raquo;&nbsp;the OpenSSL binaries page</a>
   or by downloading a recent PHP release.
   Be aware that Windows Explorer hides the <var class="filename">.cnf</var> extension
   by default and says the file Type is <em>SpeedDial</em>.
  </p>
  <p class="para">
   PHP will search for the <var class="filename">openssl.cnf</var> using the
   following logic:
   <ul class="itemizedlist">
    <li class="listitem">
     <span class="simpara">the <em>OPENSSL_CONF</em> environmental variable, if
      set, will be used as the path (including filename) of the configuration
      file.
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">the <em>SSLEAY_CONF</em> environmental variable, if
      set, will be used as the path (including filename) of the configuration
      file.
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">The file <var class="filename">openssl.cnf</var> will be assumed to be
      found in the default certificate area, as configured at the time that
      the openssl DLL was compiled.  This is usually means that the default
      filename is <var class="filename">c:\usr\local\ssl\openssl.cnf</var>.
     </span>
    </li>
   </ul>
  </p>
  <span class="simpara">
   In your installation, you need to decide whether to install the
   configuration file at <var class="filename">c:\usr\local\ssl\openssl.cnf</var> or
   whether to install it someplace else and use environmental variables
   (possibly on a per-virtual-host basis) to locate the configuration file.
   Note that it is possible to override the default path from the script using
   the <em><code class="parameter">configargs</code></em> of the functions that require a
   configuration file.
  </span>
 </p></blockquote>
</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="openssl.requirements.html">需求</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="openssl.configuration.html">运行时配置</a></div>
 <div class="up"><a href="openssl.setup.html">安装／配置</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
